#!/bin/bash
export ORACLE_SID=UFGOVDB1
username=$1
sqlplus /nolog<<END
conn sys/ufgov1234@ufgovdb1 as sysdba;
create tablespace $username datafile '/u01/app/oracle/oradata/UFGOVDB1/${username}.dbf' size 200m autoextend on next 32m maxsize unlimited extent management local;
create temporary tablespace ${username}temp tempfile '/u01/app/oracle/oradata/UFGOVDB1/${username}temp.dbf' size 32m autoextend on next 32m maxsize unlimited extent management local;
CREATE USER $username PROFILE   DEFAULT     IDENTIFIED BY crux DEFAULT TABLESPACE   $username   TEMPORARY TABLESPACE ${username}temp  ACCOUNT UNLOCK;
GRANT UNLIMITED TABLESPACE TO $username WITH ADMIN OPTION;
GRANT "CONNECT" TO $username WITH ADMIN OPTION;
grant connect,resource to $username;
grant create session, dba to $username;
END
